import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import axios from 'axios'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import { zhCn } from 'element-plus/es/locales.mjs'

import App from './App.vue'
import router from './router'

import echarts from "vue-echarts";
//import * as echarts from 'echarts';
//import { createApp } from 'vue';
// import Echarts from './path/to/your/Echarts.vue'; // 根据实际路径进行调整

const app = createApp(App)
//基础路由
axios.defaults.baseURL = "http://localhost:5055/api/"
//axios.defaults.baseURL = "http://10.31.59.10:8085/api/"
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

// 注册为全局组件
//app.config.globalProperties.$echarts = echarts;

app.provide("axios", axios)

//app.component('Echarts', Echarts);

app.use(ElementPlus, {
    locale: zhCn,
})
app.use(echarts);

app.use(createPinia())
app.use(router)

app.mount('#app')
